# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html


class TutorialPipeline(object):

    def __init__(self):
        self.hf = open("/Users/delin/Desktop/未命名文件夹/盗墓笔记2.txt","a")

    def process_item(self, item, spider):
        print(item["title"][0])
        print(item["link"][0])
        # for i in range(0,len(item["title"])):
            # print(item["title"][i])
            # print(item["link"][i])

        self.hf.write(item["title"][0] + "\n" +item["link"][0] + "\n"+ "--------------"+'\n')

        return item
